/*
 Copyright (C) 2011 Robien-Engine team

 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
 as published by the Free Software Foundation; either version 2
 of the License, or (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

 You can contact Robien-Engine team by electronic mail: robien.engine@gmail.com
 */
/****************************************
 *	Project		: RobienEngine
 * 	Name File	: ListPoint.cpp
 *
 *  Created on	: 23 mai 2011
 *      Author	: Romain
 ***************************************/

#include "../include/ListPoint.h"

ListPoint::ListPoint()
{
	typeAttribute = VERTICES;
}

ListPoint::~ListPoint()
{
}

float* ListPoint::getTab(int& size)
{
	size = positions.size();
	float* tab = new float[size];
	for(int i = 0; i< size; ++i)
	{
		tab[i] = positions[i];
	}
    return tab;
}

void ListPoint::add(Point* point)
{
    positions.push_back(point->getPosition()->x);
    positions.push_back(point->getPosition()->y);
    positions.push_back(point->getPosition()->z);
}

void ListPoint::add(Vector3f* pos)
{
    positions.push_back(pos->x);
    positions.push_back(pos->y);
    positions.push_back(pos->z);
}

void ListPoint::add(float x, float y, float z)
{
    positions.push_back(x);
    positions.push_back(y);
    positions.push_back(z);
}
